#I made a breakable glass for my game and I want it to reset and repair itself
1 messages · Page 1 of 1 (latest)
Watch Roblox Studio and millions of other Roblox Studio videos captured using Medal.
clone the glass before it breaks and then just spawn it in 1 min after the old one breaks so the new one replaces it
add a remote event to call when the glass breaks
local newglass = workspace.Glass:Clone()
newglass.Parent = game.ReplicatedStorage
game.ReplicatedStorage.GlassBrokenEvent.OnServerEvent:Connect(function()
newglass.Parent = workspace
yea
alr thanks
new one or older
theres only one glass the one in workspace
** You are now Level 2! **
in replicated storage
name it GlassBrokenEvent if u want to follow my script
or js anything rlly
as long as u change the part when you call it for the serverevent
I did
then what happened
still errors
o
delete the spaces and add tab
bc u cant do tab in discord
lol
and also
on the glass
make it Glass:Clone()
Me personally
and then now you gotta make it so that when the glass breaks its triggers the remote event
Id just keep one in server storage and clone it whenever the glass isn’t present
yea but that would create lag bc u need to use runservice
not if you destroy the glass instance and then read the change
if the game is like rlly small then you would prob do that
I already put the event in replicated storage
thats what hes doing
I'm trying it rn
add a script where when the glass breaks it triggers the remote event
yeah I wont have a big map etc
its just a game that replicate the story of the ram raids in uk
it didnt respawn
do you have any scripts already in the glass thing
lem try to fix
yes I do
** You are now Level 2! **
send it here
not directly in the glass
its in server script services
yea paste it in
under the glass.Touched line
add
oh wait its not a client script
bc
mb
add a local script in the starterplayerscripts
k
under the glass.Touched line put this
game.ReplicatedStorage.GlassBrokenEvent:FireAllClients()
then in the local script
game.ReplicatedStorage.GlassBrokenEvent.OnClientEvent:Connect(function()
game.ReplicatedStorage.GlassBrokenEvent:FireServer()
if this doesn't work try putting the cloning script into serverscriptservice
ok i gtg school now
so yeah