99
99
100
100
local function starttext ()
101
101
enabled = true
102
- local controls = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " ControlsComponent" )
103
102
local g = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " InventoryGuiComponent" )
104
103
if g ~= nil then
105
104
EntitySetComponentIsEnabled (ctx .my_player .entity , g , false )
106
105
end
107
- if controls ~= nil then
108
- ComponentSetValue2 (controls , " enabled" , false )
106
+ if not EntityHasTag (ctx .my_player .entity , " ew_notplayer" ) then
107
+ local controls = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " ControlsComponent" )
108
+ if controls ~= nil then
109
+ ComponentSetValue2 (controls , " enabled" , false )
110
+ end
109
111
end
110
112
end
111
113
112
114
local function stoptext ()
113
115
enabled = false
114
116
text = " "
115
- local controls = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " ControlsComponent" )
116
117
local g = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " InventoryGuiComponent" )
117
118
if g ~= nil then
118
119
EntitySetComponentIsEnabled (ctx .my_player .entity , g , true )
119
120
end
120
- if controls ~= nil then
121
- ComponentSetValue2 (controls , " enabled" , true )
121
+ if not EntityHasTag (ctx .my_player .entity , " ew_notplayer" ) then
122
+ local controls = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " ControlsComponent" )
123
+ if controls ~= nil then
124
+ ComponentSetValue2 (controls , " enabled" , true )
125
+ end
122
126
end
123
127
end
124
128
@@ -162,4 +166,4 @@ function module.on_world_update()
162
166
end
163
167
end
164
168
165
- return module
169
+ return module
0 commit comments