Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Click Detector dont work? GUI not appear???

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!

3 comments

0

Is there a error message?

0

No Error Messages

0

script.Parent.ClickDetector.MouseClick:Connect(function(click)

2 answers

✓ Accepted answer

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

3 comments

0

Al of the remoteEvent was for FilteringEnabled Compatibility

0

If all they are trying to do is tween a gui, why replicate?

0

I cant Upvote xD


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.

2 comments

0

this is not a script requesting site you just put a whole script

0

It's a fixed version of the script.

This discussion is preserved as it was. New answers, comments, and votes are closed.