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

Why won't this when I start up a server?

It is literally just a simple script, but If a simple script like this won't work in this... I don't know what will.

local part = script.Parent

local debounce = false

part.Touched:connect(function(hit)
local player = hit.Parent:findFirstChild("Humanoid")
if
player and debounce == false then
debounce = true
wait(.1)
print("whatever")
debounce = false
end
end)

It is a script, not a local script. It's whenever a player touches a part, it's supposed to just simply print something. Why won't it work when I put it on a server?

1 answer

part.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and debounce == false then
debounce = true 
wait(.1)
print("whatever")
debounce = false
end
end)

Try that

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