Hello, I’m trying to make it so if you touch a part, a transition will appear with Tweens. I tried it with proximity prompt and it worked, but I can’t seem to find how to refer to PlayerGUI.
This is my current code
debounce = false
script.Parent.Touched:Connect(function(player)
if not debounce then
debounce = true
script.Parent["Arena Enter - Clash Royale"]:Play()
player.PlayerGui.Transisition.Frame:TweenPosition(UDim2.new(0, 0,0, 0),
"Out",
"Bounce",
1,
true)
wait(2)
player.Character:MoveTo(script.Parent.Parent:FindFirstChild(tpname).Position)
player.PlayerGui.Transisition.Frame:TweenPosition(UDim2.new(-1, 0,0, 0),
"In",
"Sine",
1,
true)
debounce = false
end
end
end)
Is there anyway to fix this? (I’m not looking for any local scripts, since this is going to be copy pasted everywhere.)
2 things one local scripts dont work in work space and if it is a sever script you tween ui on the client and the .touched event doesn’t return a player it returns what it the part so you can just check if the hit part has a object in it parent called Humanoid then use the game.players:GetPlayerFromCharacter() function to get the player.
Thats impossible. That makes all player see it and once something is set in startergui you can no longer change it you can only do it via player gui and should be locally.