Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GUI That deletes walls but only the person that clicks the gui can see it. any help?

Asked by 6 years ago
Edited 6 years ago
script.Parent.MouseButton1Click:connect(function()
game.Workspace.Thing:Destroy()
end
end

so im tryna make a script where if u click a gui it deletes the parts. But i want it to be so that only the person that clicks the gui can see that the parts have dissapeared i do suck but i tried

0
You tryna post your attempt though? Coz we ain't got time to spoon feed you.  Zafirua 1348 — 6y
0
k WillBe_Stoped 71 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

Hello.

Here is what I have:

script.Parent.MouseButton1Click:connect(function()
    game.Workspace.Thing:Destroy()
end)

Put it in a local script and the person who clicks the gui should only see it removed.

0
i tried making it a local script dont work WillBe_Stoped 71 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
script.Parent.MouseButton1Click:connect(function()
    game.Workspace.Thing:Destroy()
end)

this code does work if placed in a local script, but there is an extra step! this extra step is to either enable 'filtering enabled' which is a property in workspace, you can go to workspace and check that, or you can place the part in the player's camera, meaning you will need to do a bit more, I would use the first one, filtering enabled is helpful, as it will block most exploits used by other players, like song exploits and others, but if you have most of your game made, I would not suggest to do it right now, or you might need to recode the whole game, but remember to enable it on any next project, ill do a quick localscript for the second option.

you will need to place the part you want later deleted in the script and rename the "Thing"s in the script to the part name and place the script in the button

--clone part into camera so other users wont see changes to it
script.Thing:Clone().Parent= game.Workspace.CurrentCamera


--Delete part when player clicks button
script.Parent.MouseButton1Click:connect(function()
    game.Workspace.CurrentCamera.Thing:Destroy()
end)
0
it works but any clue how to delete a union ? WillBe_Stoped 71 — 6y
0
It should work for anything as well popgoesme700 113 — 6y

Answer this question