Click Detector not working

Click Detector

Hi! I am making a game called Those who hunt the Fallen, and I would like to make it so that when you click on a floating object ui appears. This is the workspace configuration.
image
In the click detector there is a script:

script.Parent.MouseClick:Connect(function(plr)
	print("Hi")
	
	
	game.ReplicatedStorage.CutSceneStart:FireServer(plr)
	
end)

This is a local script.
This activates this:
image
Then In Server Script Service I have a script that does this:

game.ReplicatedStorage.CutSceneStart.OnServerEvent:Connect(function(plr)
	plr.PlayerGui.Speach.Frame.Visible = true

	plr.PlayerGui.Speach.Frame.Text.Text = "Hiax, I apear to of come across something..."
	plr.PlayerGui.Speach.Frame.Name.Text = "Liber (You)"

	wait(3)

	plr.PlayerGui.Speach.Frame.Text.Text = "Hey, 89-2b, send me visuals "
	plr.PlayerGui.Speach.Frame.Name.Text = "Hiax"



	wait(4)
	plr.PlayerGui.Speach.Frame.Text.Text = "Sending over visuals, Sir. "
	plr.PlayerGui.Speach.Frame.Name.Text = "89-2b"

	wait(3)

	plr.PlayerGui.Speach.Frame.Text.Text = "Holy s--- "
	plr.PlayerGui.Speach.Frame.Name.Text = "Hiax"

	wait(3)
	plr.PlayerGui.Speach.Frame.Visible = false
end)

This isn’t running, please help.

2 Likes

I had the same exact issue lately, Local Scripts do not run in the Workspace

Edit to tell you about the exception of a local script being inside of a player’s character

2 Likes

Hi, we got further but,
image

Since youre now using a Server script, you could also put the stuff from the script in ServerScriptService inside of the script under the ClickDetector. It will run the same, just from a different location

Hi, that worked but I have a problem again but not because of that
image

make variables to avoid typing plr.PlayerGui.SpeachFrame so many times

local SpeechFrame = plr.PlayerGui.SpeechFrame -- Speech not speach
local Name = SpeachFrame.Name
local Dialog = SpeachFrame.Dialog -- avoid repition 'Text.Text'

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.