Sand = game.Workspace:WaitForChild("Sand")
local TouchableParts = {}
local tableposition = 1
for i, v in pairs (Sand:GetChildren()) do
if v:IsA("BasePart") then
table.insert(TouchableParts, tableposition, v)
tableposition = tableposition + 1
end
end
local TouchableParts = {}
local tableposition = 1
for i, v in pairs (Sand:GetChildren()) do
if v:IsA("BasePart") then
table.insert(TouchableParts, tableposition, v)
tableposition = tableposition + 1
end
wait()
end
for i, v in pairs (TouchableParts) do
v:Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
game.ReplicatedStorage.GravityController.disabled = false
end
end)
end
✓ ANSWER ACCEPTED
So I keep getting this error Expected '(','{' or <string>, got ':' On line 25. Help?
2 answers
✓ Accepted answer
Change line 25 to this:
v.Touched:Connect(function(hit)
Maybe it was my error from yesterday when I answered your question. it's v.Touched and not v:Touched (the dot)
I assume that Touched, in this case, is a property of TouchableParts[v], so try replacing the colon with a period.
-- Replace
v:Touched:Connect(function(hit)
-- with
v.Touched:Connect(function(hit)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks. oh and btw I found out I shouldn't destroy the script instead I should just disable it