What do i want to achieve? I want to do a pizza rain in a specific zone
I did this script, no errors in the output, and it’s not working, and then i want that if the pizza touch a player then the position of the player change (i guess that i have to fireallclients for it)
local rainOrigin = script.Parent
local x = rainOrigin.Size.X / 2
local z = rainOrigin.Size.Z / 2
while true do
local rain = game.ReplicatedStorage.Pizza.MeshPart:Clone()
local rx = math.random(-x , x)
local rz = math.random(-z , z)
rain.CFrame = rainOrigin.CFrame * CFrame.new(rx, 0, rz)
wait(0.5)
end
local rainOrigin = script.Parent
local x = rainOrigin.Size.X / 2
local z = rainOrigin.Size.Z / 2
while true do
local rain = game.ReplicatedStorage.Pizza.MeshPart:Clone()
local rx = math.random(-x , x)
local rz = math.random(-z , z)
rain.CFrame = rainOrigin.CFrame * CFrame.new(rx, 0, rz)
+rain.Parent = workspace
wait(0.5)
end
local rainOrigin = script.Parent
local x = rainOrigin.Size.X / 2
local z = rainOrigin.Size.Z / 2
while true do
local rain = game.ReplicatedStorage.Pizza.MeshPart:Clone()
local rx = math.random(-x , x)
local rz = math.random(-z , z)
rain.CFrame = rainOrigin.CFrame * CFrame.new(rx, 0, rz)
rain.Parent = workspace
spawn(function()
task.wait(5)
rain:Destroy()
end)
wait(0.5)
end