This script works in studio but not in-game. No output. Its in a LocalScript in PlayerGui.
01 | local Player = game.Players.LocalPlayer |
02 | local Camera = game.Workspace.CurrentCamera |
03 | local SS = game:WaitForChild( "ServerStorage" ) |
04 | local ItemMesh = SS.CrateMeshes |
05 | local Crate = SS.Crate |
06 | Ready = true |
07 | function OnClick() |
08 | if Ready = = true then |
09 | Ready = false |
10 | local Pad = Instance.new( "Part" ) |
11 | Pad.Name = "CrateLand" |
12 | Pad.Size = Vector 3. new( 5 , 5 , 5 ) |
13 | Pad.Anchored = true |
14 | Pad.CanCollide = false |
15 | Pad.Transparency = 1 |
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()
.