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

The scripts from the beach balls won't work when I touch a brick, how do I fix this?

Asked by 4 years ago

So I want the scripts from the beach balls to run when you touch a brick, but somehow they don't work.

script.Parent.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") then
            local Beachballs = workspace.BeachBalls
              for i,v in pairs(Beachballs:GetChildren()) do
               if v:IsA("Script") then
                  v.Disabled = false
               end
            end
    end)

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Update Explanation: So I realise your problem is that you are making the scripts stop running instead of making them run. I got 2 ways for you make the scripts run.

1st Way: Delete the script for the brick. Also, I see some extra scripts under the handles of the beachball. Please delete them if you do not need 2.

You can then write these in the script of each and every handle.

workspace:WaitForChild("Brick").Touched:Connect(function()
    -- Write the codes for what you want the brick to do here.
end)
-- Do this for every script of the handles. You can just copy and paste.

Or

2nd Way: Delete the scripts for the handles. Then rename the handles to different numbers like Handle, Handle2, Handle3 and so on.

You can then write these in the script of the brick.

local BeachBalls = workspace:WaitForChild("BeachBalls")

BeachBalls:WaitForChild("Handle").Touched:Connect(function()
    -- Codes for what you want the brick to do here
end)

BeachBalls:WaitForChild("Handle2").Touched:Connect(function()
    -- Codes for what you want the brick to do here
end)

BeachBalls:WaitForChild("Handle3").Touched:Connect(function()
    -- Codes for what you want the brick to do here
end)

-- And then do this until all codes for all handles are written. You can just copy and paste then change the name of the handle.
0
I fixed it but nothing happens when I run the game User#26978 0 — 4y
0
can I have a picture of your explorer? post the screenshot on https://imgbb.com and send the link here guest_20I8 266 — 4y
0
Please include everything related to the codes in the script guest_20I8 266 — 4y
0
So this is the beach balls containing the killing script and the velocity script : https://ibb.co/D9TCfzY / This is the script that contains the for i,v in pairs from the brick : https://ibb.co/0sNH9kz User#26978 0 — 4y
0
I know whats the problem now...You are disabling the scripts instead of making it run. So instead of doing that, you can do what i wrote above (updated) guest_20I8 266 — 4y
Ad

Answer this question