Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why my instance.new keeps going on forever when i clicked it?

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!

2 comments

0

Can you send the local script that fires the remote event?

0

How do i send it to u?

1 answer

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

1 comment

0

nvm got it

This discussion is preserved as it was. New answers, comments, and votes are closed.