Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why aren't these parts being removed locally?

Asked by 5 years ago
Edited 5 years ago

Hello,

I have no idea why these parts aren't removed locally, I have very similiar scripts, where it works perfectly fine. I get no errors either.

Please, help me. What is wrong?

The script occurs, and it does work, although. It happens on the server, for everyone.

Local script (Starter GUI)

local repStorage = game:GetService("ReplicatedStorage")
local plankRemote = repStorage:WaitForChild("plankRemote")
local planksTrigger = game.Workspace.FallingPlanks.PlankTrigger
local PlanksUsed = false

planksTrigger.Touched:Connect(function(hit)

if PlanksUsed == false then

PlanksUsed = true

local player = hit.Parent:FindFirstChild("Humanoid")

if player then

print(player.Parent.Name.." touched")

plankRemote:FireClient(game.Players:GetPlayerFromCharacter(player.Parent))

end

end

end)

Normal script (ServerScriptService)

local repStorage = game:GetService("ReplicatedStorage")
local plankRemote = repStorage:WaitForChild("plankRemote")

local FallingPlanks = game.Workspace:WaitForChild("FallingPlanks")

local f1 = FallingPlanks.FallingPlanks1
local f2 = FallingPlanks.FallingPlanks2
local f3 = FallingPlanks.FallingPlanks3
local f4 = FallingPlanks.FallingPlanks4
local f5 = FallingPlanks.FallingPlanks5
local f6 = FallingPlanks.FallingPlanks6
local f7 = FallingPlanks.FallingPlanks7
local f8 = FallingPlanks.FallingPlanks8
local f9 = FallingPlanks.FallingPlanks9
local f10 = FallingPlanks.FallingPlanks10
local f11 = FallingPlanks.FallingPlanks11
local f12 = FallingPlanks.FallingPlanks12
local f13 = FallingPlanks.FallingPlanks13
local f14 = FallingPlanks.FallingPlanks14
local f15 = FallingPlanks.FallingPlanks15
local ff1 = FallingPlanks.Fall1
local ff2 = FallingPlanks.Fall2
local ff3 = FallingPlanks.Fall3
local ff4 = FallingPlanks.Fall4

plankRemote.OnClientEvent:Connect(function()

f1.Anchored = false

ff1.Anchored = false

ff2.Anchored = false

ff3.Anchored = false

ff4.Anchored = false

wait(0.05)

f2.Anchored = false

wait(0.05)

f3.Anchored = false

wait(0.05)

f4.Anchored = false

wait(0.05)

f5.Anchored = false

wait(0.05)

f6.Anchored = false

wait(0.05)

f7.Anchored = false

wait(0.05)

f8.Anchored = false

wait(0.05)

f9.Anchored = false

wait(0.05)

f10.Anchored = false

wait(0.05)

f11.Anchored = false

wait(0.05)

f12.Anchored = false

wait(0.05)

f13.Anchored = false

wait(0.05)

f14.Anchored = false

wait(0.05)

f15.Anchored = false

f1:Destroy()

ff1:Destroy()

ff2:Destroy()

ff3:Destroy()

ff4:Destroy()

wait(0.05)

f2:Destroy()

wait(0.05)

f3:Destroy()

wait(0.05)

f4:Destroy()

wait(0.05)

f5:Destroy()

wait(0.05)

f6:Destroy()

wait(0.05)

f7:Destroy()

wait(0.05)

f8:Destroy()

wait(0.05)

f9:Destroy()

wait(0.05)

f10:Destroy()

wait(0.05)

f11:Destroy()

wait(0.05)

f12:Destroy()

wait(0.05)

f13:Destroy()

wait(0.05)

f14:Destroy()

wait(0.05)

f15:Destroy()



end)
2
I think you have your scripts reversed, try switching the code in each script and redefine your variables if needed MegaManSam1 207 — 5y
1
You can also simplify your script using loops MegaManSam1 207 — 5y
0
Figured it out Similaritea 58 — 5y

Answer this question