Hello
I have a Problem with my Simple Click Detector
When i click it the GUI dont appear? Why?
Thats my Script inside the Part:
function onClicked() print("Clicked!") game.StarterGui.ChekIn.Frame::TweenPosition(UDim2.new(0.5, -343,0.5, -147)) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
I hope somebody can help me!
Ok what you are doing is wrong because the gui is IN THE PLAYERS STARTER GUI.
instead of saying game.startergui
you make a RemoteEvent in the replictatedstorage
im not good at using remoteevents so im looking at the wiki a bit (I cant memorize...)
so in the script intead of saying
function onClicked() print("Clicked!") game.StarterGui.ChekIn.Frame::TweenPosition(UDim2.new(0.5, -343,0.5, -147) end)
to this:
local Event = game.ReplicatedStorage.(The name of the remoteEvent) function onClicked(player) print("Clicked!") Event:FireClient(player) end)
and put a local script in the frame in Checkin.Frame
then type in the local script
local Event = game.ReplicatedStorage.(The name of the remoteEvent) function OnClick() Whatever happens end Event.OnClientEvent:connect(OnClick)
if this worked upvote
local PlayerService = game:GetService("Players"); local ClickDetector = blah blah blah.ClickDetector local onClicked = function(player) print("Clicked!") if player.Name == ( PlayerService.LocalPlayer.Name ) then PlayerService.LocalPlayer.PlayerGui.ChekIn.Frame:TweenPosition(UDim2.new(0.5, -343,0.5, -147)); end end; ClickDetector.MouseClick:connect(onClicked)
Not tested but it should work. Run this is in a local script.