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:
script.Parent.Touched:connect(function(hit) if hit.Name == ("Right Leg") or hit.Name == ("Left Leg") then for i,v in pairs(game.Players:GetPlayers()) do v.Character.Torso.CFrame = v.Character.Torso.CFrame * CFrame.new(2,2,2) local cam = workspace.CurrentCamera cam.CFrame = workspace.carroom.Cam.CFrame cam.CameraType = "Scriptable" v.PlayerGui.Upgradeshop.Enabled = true for a,k in pairs(v:GetChildren()) do if k:IsA("Model") then k:Destroy() end end wait(1) if v.SelectedCar.Value == nil then v.PlayerGui.Upgradeshop.TextLabel.Visible = true end local d = v.SelectedCar.Value:Clone() d:SetPrimaryPartCFrame(game.Workspace.carroom.carspawn.CFrame * CFrame.fromEulerAnglesXYZ(0,0,1.55) * CFrame.new(-1,1,0)) d.Parent = cam v.PlayerGui.Upgradeshop.Frame.Visible = true wait(0.1) while wait() do d:SetPrimaryPartCFrame(d.Body.Base.CFrame * CFrame.fromEulerAnglesXYZ(0,.1,0)) end end end end)
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.