I made the Simplest of scripts and it doesn’t work. Your supposed to click on the Model’s hitbox, then I use Destroy() to make my model Get deleted from the client. It’s also supposed to play a sound once it gets removed (Turned on in the Properties)
Here’s the Script:
script.Parent.ClickDetector.MouseClick:Connect(function(player)
script.Parent:Destroy() -- depends if the script's parent is the model you want to destroy
-- for the sound now
local soundname = game.SoundService.soundname
soundname:play()
(by the way can we get more informations on what script you used, picture of the workspace, and properties pictures please.)
local script or script
did you try with remotevents ?
have you looked on the forum for similar problems before posting ?
Basically, you create a remote event in ReplicatedStorage
just follow this script:
local cd = script.Parent.ClickDetector
local event = game.ReplicatedStorage.RemoteEvent
cd.MouseClick:Connect(function(plr)
event:FireClient(plr)
end)
now on the client
local event = game.ReplicatedStorage.RemoteEvent
event.OnClientEvent:Connect(function(plrSentBy)
workspace.Model:Destroy() -- put ur model path here
end)
Thanks Everyone for the help. I found out what the problem was. I just had to put the script in StarterPlayer → StarterPlayerScripts
Thanks, And sorry for the trouble