okay so, i tested it out… its working until line 5 of the server code, i updated the local script to detect when the part is touched too, for some reason just had to rewrite.
local rp = game:GetService("ReplicatedStorage")
local debounce = false
workspace.bruh.Touched:Connect(function()
print("brothatcool")
if debounce == false then
print("thisisaredumb")
debounce = true
rp.RemoteEvent:FireServer()
wait(5)
debounce = false
end
end)
script.Parent.Touched:Connect(function(h)
local hum = h.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(h.Parent)
if player.leaderstats.Wins.Value <= 0 then
h.Parent.HumanoidRootPart.CFrame = h.Parent.HumanoidRootPart.CFrame + Vector3.new(0,10,0)
end
end)
yeah my script works… also that really should work, works with me, you need to make sure the part has streaming enabled = true and i added some prints, increased the value and it worked
also you should make sure leaderstats exists by checking the name of your thing containing wins, and if it is then :WaitForChild()
This is the script I got from you (modified). None of the Prints work
LocalScript:
local rp = game:GetService("ReplicatedStorage")
local debounce = false
script.Parent.Touched:Connect(function()
print("Part touched")
if debounce == false then
print("DebounceFalse")
debounce = true
rp.WinnersTeleport:FireServer()
wait(5)
debounce = false
end
end
Script:
ReplicatedStorage.WinnersTeleport.OnServerEvent:Connect(function(player)
print("Received Remote")
if player.leaderstats.Wins.Value < 0 then
print("If/else Done")
player.Character.HumanoidRootPart.CFrame = CFrame.new(0,0,0)
end
end)