✓ Accepted answer
Hi lolkid007! I'm here to help you. You don't can have access to the players folder with the server. So to create that, you do need to use:
LocalScript
RemoteEvent
So put a RemoteEvent on ReplicatedStorage. Put a LocalScript on your ScreenGui and now write this.
LocalScript:
local text = game:GetService('Players').LocalPlayer.PlayerGui:WaitForChild("ScreenGui")
function onClicked()
wait(1)
for i = 1, 10 do
text.Frame.TextLabel.TextTransparency = text.Frame.TextLabel.TextTransparency - 0.1
wait(0.01)
end
end
game:GetService('ReplicatedStorage').RemoteEvent.OnClientEvent:Connect(onClicked)
And this is now your Script in the workspace.
local part = game:GetService('Workspace').handle
part.Button.ClickDetector.MouseClick:Connect(function(Player)
game:GetService('ReplicatedStorage').RemoteEvent:FireClient(Player)
end)
1 comment
"text" as a variable for a ScreenGui is misleading. Use a better variable name.