I created a script in a part and I scripted this:
triggername="FogTrigger2" function onTouched(part) if part.Parent ~= nil then local h = part.Parent:findFirstChild("Humanoid") if h~=nil then local teleportfrom=script.Parent.Enabled.Value if teleportfrom~=0 then local lightning = game.Lighting lightning.FogColor = Color3.fromRGB(193, 184, 115) lightning.FogEnd = 100 else print("Could not find the trigger") end end end end script.Parent.Touched:connect(onTouched)
Now how to do it works only for Local Player? I enabled Filtered Enabled and isn't working. Thanks.
You can use a remote event. Or even a local script.
It's easier to use a LocalScript. Simply put it somewhere that it will execute and copy that exact code. Just change the last line:
local Part = game.Workspace.Part -- CHANGE THIS Part.Touched:connect(function(part) if part.Parent.Name == game.Players.LocalPlayer.Name then onTouched(part) end end)
Haven't test code. Let me know if there's errors.
local part = game.Workspace.INSERT PART NAME HERE part.Touched:Connect(function() end)
you can clone your smoke each time, and replace the function with my code.