Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Click Detector dont work? GUI not appear???

Asked by 4 years ago

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!

0
Is there a error message? Mrtrainhead3617 2 — 4y
0
No Error Messages RedstonecraftHD 25 — 4y
0
script.Parent.ClickDetector.MouseClick:Connect(function(click) pranvexploder 14 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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...)

here

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

0
Al of the remoteEvent was for *FilteringEnabled* Compatibility Luka_Gaming07 534 — 4y
0
If all they are trying to do is tween a gui, why replicate? coolboy6786543 113 — 4y
0
I cant Upvote xD RedstonecraftHD 25 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
this is not a script requesting site you just put a whole script Luka_Gaming07 534 — 4y
0
It's a fixed version of the script. coolboy6786543 113 — 4y

Answer this question