Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my script not even detect anything in output?

Asked by 4 years ago
Sand = game.Workspace:WaitForChild("Sand")
 script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        game.ReplicatedStorage.GravityController.Disable = false
    end
end)
0
Can you elaborate on your problem thatwalmartman 404 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I helped you in community chat, the problem is that you cannot disable module scripts, your expected solution was to destroy the module,

game.ReplicatedStorage.GravityController:Destroy()

There is another way, you can just parent it somewhere else so that other scripts can't find the module. That might result in an error so make sure to add WaitForChild to the scripts requiring the module.

Make sure the localscript is in startergui.

If this helps remember to accept the answer.

local Sand = game.Workspace:WaitForChild("Sand")
local Debounce = false
 Sand.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    if Debounce == false then Debounce = true
         game.ReplicatedStorage.GravityController:Destroy()
         print("Module successfully destroyed")
    end
    end
end)
Ad

Answer this question