My script that i made is supposed to show an GUI when you step on the specific block. It works on studio but not ingame. Could someone help me ? here is the script:
01 | script.Parent.Touched:connect( function (hit) |
02 | if hit.Name = = ( "Right Leg" ) or hit.Name = = ( "Left Leg" ) then |
03 | for i,v in pairs (game.Players:GetPlayers()) do |
04 | v.Character.Torso.CFrame = v.Character.Torso.CFrame * CFrame.new( 2 , 2 , 2 ) |
05 | local cam = workspace.CurrentCamera |
06 | cam.CFrame = workspace.carroom.Cam.CFrame |
07 | cam.CameraType = "Scriptable" |
08 | v.PlayerGui.Upgradeshop.Enabled = true |
09 | for a,k in pairs (v:GetChildren()) do |
10 | if k:IsA( "Model" ) then |
11 | k:Destroy() |
12 | end |
13 | end |
14 | wait( 1 ) |
15 | if v.SelectedCar.Value = = nil then |
Is your script FE? If not, then set it to be, you won't regret it, trust me. You should put the part of the script that makes the gui appear in a local script inside the player and tie it with the script which detects the touch using a remoteevent (if you want the gui to appear on all players, just do :FireAllClients (or something like that))
If you don't understand, you should probably look up remote events.