Why won't my property change gui work?
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):
01 | local allowed = { "ISkyLordDoge" } |
03 | game.Players.PlayerAdded:Connect( function (player) |
04 | for i, v in pairs (allowed) do |
05 | if player.Name = = v then |
06 | script.SendProperties:Clone().Parent = player:WaitForChild( "PlayerGui" ) |
11 | game.ReplicatedStorage.ChangeProperties.OnServerEvent:Connect( function (player,BrickColorText,Material,Orientation,Position,Transparency) |
12 | for i,v in pairs (allowed) do |
13 | if player.Name = = v then |
14 | game.ReplicatedStorage.ChangeProperties:FireAllClients(BrickColorText,Material,Orientation,Position,Transparency) |
15 | game.ReplicatedStorage.CanChange.Value = false |
17 | game.ReplicatedStorage.CanChange.Value = true |
Local Script (In the GUI):
01 | local frame = script.Parent.Frame |
02 | local BrickColorText = frame.BrickColor.Text |
03 | local Material = frame.Material.Text |
04 | local Orientation = frame.Orientation.Text |
05 | local Position = frame.PositionE.Text |
06 | local Transparency = frame.TransparencyE.Text |
09 | script.Parent.Parent:WaitForChild( "Toggle" ).MouseButton 1 Click:Connect( function () |
10 | if script.Parent.Visible = = true then |
11 | script.Parent.Visible = false |
13 | script.Parent.Visible = true |
18 | for i,property in pairs (script.Parent.Frame:GetChildren()) do |
19 | if property.Changed then |
20 | script.Parent.Submit.MouseButton 1 Click:Connect( function () |
21 | if game.ReplicatedStorage.CanChange.Value = = true and db = = true then |
23 | game.ReplicatedStorage.ChangeProperties:FireServer(BrickColorText,Material,Orientation,Position,Transparency) |
26 | script.Parent.Submit.Text = "Cannot send now" |
29 | script.Parent.Submit.Text = "Send" |
35 | script.Parent.Cancel.MouseButton 1 Click:Connect( function () |
36 | script.Parent.Visible = false |
Local Script (In the part I'm trying to change the property of):
1 | game.ReplicatedStorage.ChangeProperties.OnClientEvent:Connect( function (BrickColorText,Material,Orientation,Position,Transparency) |
2 | local part = game.Workspace.PropertyPart |
3 | part.BrickColor = BrickColor.new( tostring (BrickColorText)) |
4 | part.Material = Enum.Material.Material |
5 | part.Orientation = Vector 3. new(Orientation) |
6 | part.Position = Vector 3. new(Position) |
7 | part.Transparency = Transparency |