9999
100100local function starttext ()
101101 enabled = true
102- local controls = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " ControlsComponent" )
103102 local g = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " InventoryGuiComponent" )
104103 if g ~= nil then
105104 EntitySetComponentIsEnabled (ctx .my_player .entity , g , false )
106105 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
109111 end
110112end
111113
112114local function stoptext ()
113115 enabled = false
114116 text = " "
115- local controls = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " ControlsComponent" )
116117 local g = EntityGetFirstComponentIncludingDisabled (ctx .my_player .entity , " InventoryGuiComponent" )
117118 if g ~= nil then
118119 EntitySetComponentIsEnabled (ctx .my_player .entity , g , true )
119120 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
122126 end
123127end
124128
@@ -162,4 +166,4 @@ function module.on_world_update()
162166 end
163167end
164168
165- return module
169+ return module
0 commit comments