Text not appearing after clicking part

I am trying to make a text appear after clicking a part but for some reason it isn’t. I couldn’t find any help on YouTube nor google so I was wondering if I can find help here. Also, the script is a server script, and I am not sure if it is supposed to be a local script.

I see the problem, you’re using startergui, instead use playergui.

So I replace startergui with playergui, correct?

Yes, any changes made to the GUIS in startergui wont replicate.

put this script in local script

local Part = script.Parent
local High = Part.Higlight
local D1 = game.Players.LocalPlayer.PlayerGui["Self-Dialogue"].ScreenGui.D1

How would you access the part using “script.Parent” on a localscript.

then ig he can use this

local Part = game.Workspace.Part
local High = Part.Higlight
local D1 = game.Players.LocalPlayer.PlayerGui["Self-Dialogue"].ScreenGui.D1

I’ll test this out if it works or not

If you REALLY want to do this on a server script, do this:

local Part = workspace.Part
local High = Part.Highlight

local TweenService = game:GetService("TweenService")

local Info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0)

local Goals = {
	TextTransparency = 1
}

Part.ClickDetector.MouseHoverEnter:Connect(function()
	High.Enabled = true
end)

Part.ClickDetector.MouseHoverLeave:Connect(function()
	High.Enabled = false
end)

Part.ClickDetector.MouseClick:Connect(function()
	for index, player in pairs(game.Players:GetChildren()) do
		local D1 = player:WaitForChild("PlayerGui"):WaitForChild("Self-Dialouge"):WaitForChild("ScreenGui").D1
		D1.TextTransparency = 0
		task.wait(2)
		TweenService:Create(D1,Info,Goals):Play()
	end
end)
1 Like

@kittyPGR I used your script and now the highlight doesn’t work nor the clicking event even when I changed the variable’s path. I get no errors either.

local Pistol = game.Workspace.HouseDock.House.Pistol
local High = game.Workspace.HouseDock.House.Pistol.Highlight
local D1 = game.Players.LocalPlayer.PlayerGui["Self-Dialogue"].ScreenGui.D1

Pistol.ClickDetector.MouseHoverEnter:connect(function()
	High.Enabled = true
end)
Pistol.ClickDetector.MouseHoverLeave:connect(function()
	High.Enabled = false
end)

Pistol.ClickDetector.MouseClick:Connect(function()
	D1.TextTransparency = 0
	wait(2)
	for i = 1,100 do
		D1.TextTransparency += 0.01
		wait(0.01)
	end
end)

Oh, I didn’t notice this. My bad

Remember to play the tween, or it wont work.

What do you mean? Also, I get this error:

Its a spelling mistake, change it to MouseHoverEnter

or maybe you can try this

server script

Server script
local Pistol = game.Workspace.HouseDock.House.Pistol
local High = game.Workspace.HouseDock.House.Pistol.Highlight
local RE = --remote event

Pistol.ClickDetector.MouseHoverEnter:connect(function()
	High.Enabled = true
end)
Pistol.ClickDetector.MouseHoverLeave:connect(function()
	High.Enabled = false
end)

Pistol.ClickDetector.MouseClick:Connect(function()
    RE.FireAllClint()
end)

Local script
local RE
local D1 = game.Players.LocalPlayer.PlayerGui["Self-Dialogue"].ScreenGui.D1
RE.OnClintEvent:Connect(function()

D1.TextTransparency = 0
	wait(2)
	for i = 1,100 do
		D1.TextTransparency += 0.01
		wait(0.01)
	end
end)
1 Like

I edited my script; it plays the tween and fixes that spelling mistake. Copy the script again and change it for your needs.

Still isn’t working but I get this warning:

Another spelling mistake. Change it to the correct version. If you see an error or a warning its most likely a spelling mistake.

Ok, sorry for not noticing that spelling mistake.

Edit: I test it and it works finally. Thank you so much.