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

The part that I wanted to spawn doesnt spawn?

im trying to create a touched event, so whenever it is touched, it clones a part named "Shockwave" in a certain folder with its parent as ReplicatedStorage. However, it doesnt clone the part and there's no output in the console. Here's my code:

local function onTouched(hit)
	local rep = game:GetService("ReplicatedStorage")
	local folder = rep:WaitForChild("DFModels")
	local shock = folder:FindFirstChild("Shockwave")
	shock.Parent = game.Workspace
	shock.Position = Vector3.new(script.Parent.Position.X, 1, script.Parent.Position.Z)
	for i=6, 30, 2 do
		shock.Size = Vector3.new(i,1,i)
		wait(.1)
	end
	for i=0, 1, .1 do
		shock.Transparency = i
		wait(.1)
	end
	shock:Destroy()
end

script.Parent.Touched:Connect(onTouched)

I hope someone would be kind enough to help :D

2 comments

0

I saw your other comment about not doing :Clone(), have you changed the parent? If the item is in ReplicatedStorage, it won't be visible.

0

im making a clone then making the clone's parent to workspace. my other model in repstorage works fine, so idk whats wrong with this one

1 answer

SRY i was dumb and didnt put :Clone() EDIT: even with clone it doesnt work

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