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

Script wont work in-game?

Asked by
Zyleak 70
9 years ago

This script works in studio but not in-game. No output. Its in a LocalScript in PlayerGui.

01local Player = game.Players.LocalPlayer
02local Camera = game.Workspace.CurrentCamera
03local SS = game:WaitForChild("ServerStorage")
04local ItemMesh = SS.CrateMeshes
05local Crate = SS.Crate
06Ready = true
07function OnClick()
08if Ready == true then
09Ready = false
10local Pad = Instance.new("Part")
11Pad.Name = "CrateLand"
12Pad.Size = Vector3.new(5, 5, 5)
13Pad.Anchored = true
14Pad.CanCollide = false
15Pad.Transparency = 1
View all 61 lines...

1 answer

Log in to vote
1
Answered by
Reselim 35
9 years ago

Your 'error' is that WaitForChild is forever waiting, because ServerStorage isn't replicated to the client.

Consider using ReplicatedStorage or ReplicatedFirst instead. Also, I'd recommend using game:GetService() or game:FindService().

Ad

Answer this question