Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

5 comments

0

I fixed it but nothing happens when I run the game

0

can I have a picture of your explorer? post the screenshot on https://imgbb.com and send the link here

0

Please include everything related to the codes in the script

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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.