when i clone a script from the replicatedstorage to the workspace the script doesnt work??
Asked by
6 years ago Edited 6 years ago
so heres my issue: i am making a box destroying minigame and u have to destroy boxes to get more points. when there is no more boxes in the workspace, its supposed to clone one box from the replicated storage to the workspace, and it does that. and the script from the box in the workspace works. however when the one in the replicated storage is cloned into workspace, that scrip(which is the same) no longer works? help!!
script in serverscriptservice
02 | if not workspace:FindFirstChild( "box" ) then |
05 | local msg = Instance.new( "Message" , workspace) |
06 | msg.Text = "No more boxes! Reshuffling..." |
07 | local clone = game.ServerStorage.box:Clone() |
08 | clone.Parent = workspace |
script in the box
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | local leader = plr:WaitForChild( "leaderstats" ) |
03 | local box = leader:FindFirstChild( "Boxes Destroyed" ) |
04 | script.Parent.Touched:Connect( function (hit) |
05 | local h = hit.Parent:WaitForChild( "Humanoid" ) |
08 | box.Value = box.Value + 1 |
09 | script.Parent:Destroy() |
Any help would be greatly appreciated oWo