Hello, I've made this simple script that moves GUIs when you touch some parts, in studio, it works fine. But if you go play it on Roblox itself, it doesn't do anything. I have no idea what I've done wrong.. can someone please help me?
Script:
local SG = game:GetService("StarterGui") local Cs = SG.CutScenes script.Parent.Touched:Connect(function() Cs.UpperFrame:TweenPosition(UDim2.new(0,0,0,-35), "Out", 1) Cs.LowerFrame:TweenPosition(UDim2.new(0, 0,0.793, 0), "Out", 1) wait(6.25) Cs.TransPArencyFrame:TweenPosition(UDim2.new(0,0,0,0), "Out", 1) wait(1.6) Cs.TransPArencyFrame:TweenPosition(UDim2.new(0,0,1,0), "Out", 1) wait(0.8) Cs.UpperFrame:TweenPosition(UDim2.new(0,0,0,-150), "Out", 1) Cs.LowerFrame:TweenPosition(UDim2.new(0,0,1,0), "Out", 1) wait(1.1) warn("T R I G G E R E D B O I") script:Destroy() end)
BTW: I'm a noob scripter
The StarterGui
service is a list of a list of GUIs (Graphical User Interface)s that will replicate to the player when they join. The problem here is thtat you are editing the GUI in StarterGui
, rather then the one in PlayerGui
.
--[[ READ ME READ ME READ ME I've edited this script to work with FilteringEnabled. Here is what to do: 1) Edit the "partLocation" variable to the part you want touched (example: game.Workspace.Part) 2) Paste this code into a LocalScript 3) Put the LocalScript into StarterGui or any GUI. Also you are missing the Transition Style arguement, so I filled it in for you. --]] local plr = game.Players.LocalPlayer local SG = plr:WaitForChild("PlayerGui") local Cs = SG.CutScenes local partLocation -- EDIT THIS partLocation.Touched:Connect(function() Cs.UpperFrame:TweenPosition(UDim2.new(0,0,0,-35), "Out", "Quad", 1) Cs.LowerFrame:TweenPosition(UDim2.new(0, 0,0.793, 0), "Out", "Quad", 1) wait(6.25) Cs.TransPArencyFrame:TweenPosition(UDim2.new(0,0,0,0), "Out", "Quad", 1) wait(1.6) Cs.TransPArencyFrame:TweenPosition(UDim2.new(0,0,1,0), "Out", "Quad", 1) wait(0.8) Cs.UpperFrame:TweenPosition(UDim2.new(0,0,0,-150), "Out", "Quad", 1) Cs.LowerFrame:TweenPosition(UDim2.new(0,0,1,0), "Out", "Quad", 1) wait(1.1) warn("T R I G G E R E D B O I") script:Destroy() end)