I am making a test game and to test and spawn boss u need to click the button on the gui. However, i am having a trouble with the button "Delete all boss" i scripted it that it deletes the original folder and creates a new one Here is the script:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = ReplicatedStorage:WaitForChild("DeletezaBossu") local ServerStorage = game:GetService("ServerStorage") local Workspace = game:GetService("Workspace") local Boss = game.Workspace.Boss function onServerEvent(player) Boss:Destroy() wait(1) local Boss = Instance.new("Folder") Boss.Name = "Boss" Boss.Parent = Workspace end remoteEvent.OnServerEvent:Connect(onServerEvent)
any help appreciated!
You forgot an end after this:
remoteEvent.OnServerEvent:Connect(onServerEvent)
You should do this:
remoteEvent.OnServerEvent:Connect(onServerEvent) end
I'm pretty new to scripting tho so it may be wrong