Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my script not even detect anything in output?

Sand = game.Workspace:WaitForChild("Sand")
 script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        game.ReplicatedStorage.GravityController.Disable = false
    end
end)

1 comment

0

Can you elaborate on your problem

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.