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

How do I make a TextButton when it's clicked make a part change the properties?

So I have been trying to make a script where my text button when it is clicked will change a parts properties.

This is my script, yes a normal script.

script.Parent.MouseButton1Click:Connect(function()
	game.Workspace.Part.CanCollide = true
	game.Workspace.Part.Transparency = 0
end)

Can you please tell me what is wrong? Thank you.

1 answer

It's wrong because it's not using FE.

Make sure this script is a local script:

script.Parent.MouseButton1Click:Connect(function()
	    game.ReplicatedStorage.FireableEvent:FireServer()
end)

In the ServerScriptService, make a server script.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = Instance.new("RemoteEvent", ReplicatedStorage)
Event.Name = "FireableEvent"
local function onFiredEventEvent(Player)
	 game.Workspace.Part.CanCollide = true
	 game.Workspace.Part.Transparency = 0
end
Event.OnServerEvent:Connect(onFiredEventEvent)

1 comment

0

Okay! Let me try the script.

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