the parts code:
local part = script.Parent
local serverevent = game.ReplicatedStorage.cylinder1spawn
local Dunebuggy = game.Workspace.DuneBuggy
part.Touched:Connect(function(hit)
if hit.Parent == Dunebuggy then
part.Transparency = 0.5
print("working1")
part.Anchored = false
part.BrickColor = BrickColor.new("Bright red")
local fire = part.Fire
print("working2")
fire.Emiision.Enabled = true
wait(3)
print("worked3")
serverevent:FireServer()
part:Destroy()
end
end)
script that spawns the part.
local spawnevent = game.ReplicatedStorage["spawn part"]
spawnevent.OnServerEvent:Connect(function()
local cylinderpart = Instance.new("Part")
cylinderpart.Shape = cylinderpart
cylinderpart.Parent = workspace
cylinderpart.Position = Vector3.new(120.145, 15.551, -42.71)
cylinderpart.Size = Vector3.new(11.102, 3.806, 4.804)
cylinderpart.BrickColor = BrickColor.new("Medium stone grey")
wait(5)
cylinderpart:Clone()
end)
Dune buggy:
the part:
all the main parts (for now)
for some reason the scripts don’t work and it wont function when the model touches it.
robloxapp-20210604-1901498.wmv (2.1 MB)
the issue is that when the model (dune buggy) touches the part its supposed to make the parts script function and wait 3 seconds then it fires a server event, when the server event is fired the spawn script will Clone the part so the script can work again.