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 5 years ago
1Sand = game.Workspace:WaitForChild("Sand")
2 script.Parent.Touched:Connect(function(hit)
3    if hit.Parent:FindFirstChild("Humanoid") then
4        game.ReplicatedStorage.GravityController.Disable = false
5    end
6end)
0
Can you elaborate on your problem thatwalmartman 404 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 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,

1game.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.

01local Sand = game.Workspace:WaitForChild("Sand")
02local Debounce = false
03 Sand.Touched:Connect(function(hit)
04    if hit.Parent:FindFirstChild("Humanoid") then
05    if Debounce == false then Debounce = true
06         game.ReplicatedStorage.GravityController:Destroy()
07         print("Module successfully destroyed")
08    end
09    end
10end)
Ad

Answer this question