Hello, I'm trying to make a property change gui to easily change some properties of a part for a part of teaching my friends how to script, by observing the properties of a part and changing them. Can anyone help me fix this issue? Thanks! I know this script may be messy, I'm sorry, but I just made this script and I'm not sure where the issue is, it's not outputted. Once again, thank you!:
PartPropertyHandler (ServerScriptService):
local allowed = {"ISkyLordDoge"}
game.Players.PlayerAdded:Connect(function(player)
for i, v in pairs(allowed) do
if player.Name == v then
script.SendProperties:Clone().Parent = player:WaitForChild("PlayerGui")
end
end
end)
game.ReplicatedStorage.ChangeProperties.OnServerEvent:Connect(function(player,BrickColorText,Material,Orientation,Position,Transparency)
for i,v in pairs(allowed) do
if player.Name == v then
game.ReplicatedStorage.ChangeProperties:FireAllClients(BrickColorText,Material,Orientation,Position,Transparency)
game.ReplicatedStorage.CanChange.Value = false
wait(5)
game.ReplicatedStorage.CanChange.Value = true
end
end
end)
Local Script (In the GUI):
local frame = script.Parent.Frame
local BrickColorText = frame.BrickColor.Text
local Material = frame.Material.Text
local Orientation = frame.Orientation.Text
local Position = frame.PositionE.Text
local Transparency = frame.TransparencyE.Text
script.Parent.Parent:WaitForChild("Toggle").MouseButton1Click:Connect(function()
if script.Parent.Visible == true then
script.Parent.Visible = false
else
script.Parent.Visible = true
end
end)
local db = true
for i,property in pairs(script.Parent.Frame:GetChildren()) do
if property.Changed then
script.Parent.Submit.MouseButton1Click:Connect(function()
if game.ReplicatedStorage.CanChange.Value == true and db == true then
db = false
game.ReplicatedStorage.ChangeProperties:FireServer(BrickColorText,Material,Orientation,Position,Transparency)
else
db = false
script.Parent.Submit.Text = "Cannot send now"
wait(2)
db = true
script.Parent.Submit.Text = "Send"
end
end)
end
end
script.Parent.Cancel.MouseButton1Click:Connect(function()
script.Parent.Visible = false
end)
Local Script (In the part I'm trying to change the property of):
game.ReplicatedStorage.ChangeProperties.OnClientEvent:Connect(function(BrickColorText,Material,Orientation,Position,Transparency)
local part = game.Workspace.PropertyPart
part.BrickColor = BrickColor.new(tostring(BrickColorText))
part.Material = Enum.Material.Material
part.Orientation = Vector3.new(Orientation)
part.Position = Vector3.new(Position)
part.Transparency = Transparency
end)

13 comments
Why would you FireAllClients? Seems very useless
i adapted that, but im not sure why it has a problem with EnumItem outputted: 20:59:35.409 - material1 is not a valid EnumItem 20:59:35.410 - Stack Begin 20:59:35.411 - Script 'Workspace.PropertyPart.Script', Line 4 20:59:35.412 - Stack End
tried switching to player gui rather than starter gui but still doesnt work :/
What's the issue? Change line 4 to Enum.Material[Material] to fix the error above.
still doesn't work : / (sorry if i sound rude)
Also the server doesn't have access to PlayerGui.
i meant i changed player gui in the local script which was in the gui, btw the material variable is seen as '' (nothing, basically), by any chance, do you know the problem? thanks!
My Questions: 1. Can you see the GUI? 2. What happens when you press the Submit Button? 3. On line 19, is there a child object named "property"?
1: I can see the GUI. 2. When I press the submit button, it says 'Cannot Send'. 3. No.
What is the "Changed" after property because it's an event that fires when something is changed so it should connected to a function, and the "CanChange" value must be false because the debounce isn't.
I dont know how I didn't spot this before but you need to change the top variables without the .Text because it'll be blank since its taking the text when you first declared them. You need to add .Text to the ends of the parameters in your FireServer.
property's class is a TextBox and when it is changed i want to fire the server with parameters of the text which has been changed. also, where could I change the canChange value to false?
now it's just assuming 'Really red' as an enum value whilst its being classed for brickcolourtext which is not using enum