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

Script works in studio and simulated servers but not game?

Asked by 4 years ago

No idea why, its a server script after all. Thanks.


local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local ReplicatedFirst = game:GetService("ReplicatedFirst") local tools = ReplicatedStorage.Tools Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) wait(1) if player.TeamColor.Name == "Bright blue" then print "police" local cuffs = tools.cuffs:Clone() cuffs.Parent = player:WaitForChild("Backpack") local pistol = tools.pistol:Clone() pistol.Parent = player:WaitForChild("Backpack") local tazor = tools.tazor:Clone() tazor.Parent = player:WaitForChild("Backpack") local card = tools.card:Clone() card.Parent = player:WaitForChild("Backpack") elseif player.TeamColor.Name == "Bright orange" then print "prisioner" local cuffs = tools["steal card"]:Clone() cuffs.Parent = player:WaitForChild("Backpack") end end) end)
0
There should be no reason why this doesnt work in your game but it does in studio. Did you actually publish the game? Save does nothing iiConstable_Subwayx 130 — 4y
0
The police seem to get their tools always but the prisioners only in studio even if I formatt is diffrentlty. birdeater11 14 — 4y

Answer this question