#I made a breakable glass for my game and I want it to reset and repair itself

1 messages · Page 1 of 1 (latest)

rancid scarab
#

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

sour kayak
#

lem do this

#

is it infinite use ?

rancid scarab
#

yea

sour kayak
#

alr thanks

rancid scarab
#

put this script in the glass

#

and add the remote event

sour kayak
#

new one or older

rancid scarab
#

theres only one glass the one in workspace

blazing muskBOT
#

studio** You are now Level 2! **studio

sour kayak
#

where do I put the remote event ?

#

and what name for the remote event

rancid scarab
#

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

sour kayak
#

I did

rancid scarab
#

then what happened

sour kayak
#

still errors

rancid scarab
#

o

#

delete the spaces and add tab

#

bc u cant do tab in discord

#

lol

#

and also

#

on the glass

#

make it Glass:Clone()

sour kayak
#

I said end

#

good now?

hearty shuttle
#

Me personally

rancid scarab
#

and then now you gotta make it so that when the glass breaks its triggers the remote event

hearty shuttle
#

Id just keep one in server storage and clone it whenever the glass isn’t present

rancid scarab
#

yea but that would create lag bc u need to use runservice

hearty shuttle
#

not if you destroy the glass instance and then read the change

rancid scarab
#

if the game is like rlly small then you would prob do that

sour kayak
rancid scarab
#

thats what hes doing

sour kayak
#

I'm trying it rn

rancid scarab
sour kayak
#

its just a game that replicate the story of the ram raids in uk

#

it didnt respawn

rancid scarab
#

do you have any scripts already in the glass thing

sour kayak
#

lem try to fix

blazing muskBOT
#

studio** You are now Level 2! **studio

rancid scarab
#

send it here

sour kayak
#

not directly in the glass

rancid scarab
#

yea but it still inteferes with the process

#

bc thats the system script right

sour kayak
#

its in server script services

rancid scarab
#

yea paste it in

sour kayak
#

its not my glass system

#

I said I made it but its not

rancid scarab
#

under the glass.Touched line

#

add

#

oh wait its not a client script

#

bc

#

mb

#

add a local script in the starterplayerscripts

sour kayak
#

I'm afk for some mintes

#

take your time

rancid scarab
#

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

sour kayak
#

lem do it

#

thanks !

sour kayak
#

it didnt work for me

#

I'm sure 100% its confusion

sour kayak
#

so yeah