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

Lucky Block Script not working? Please help i dont know whats wrong ddddddddddddd?

I made this lucky block script for my lucky block so it does a random thing but nothing works at all can u tell me what did i do wrong? Script:

script.Parent.Activated:Connect(function(player)
script.Parent:Destroy()
local Roar = math.random(1,30)
if Roar == 1 or 2 or 3 or 4 or 5 then 
player.Character.Humanoid.MaxHealth = 1000
elseif Roar == 6 or 7 or 8 or 9 or 10 then
game.ServerStorage.Nothing:Clone().Parent = player.PlayerGui wait (2)
player.PlayerGui.Nothing:Destroy()
elseif Roar == 11 or 12 or 13 or 14 or 15 then
player.Character.Humanoid.Health = 0
elseif Roar == 16 then
game.ServerStorage["LUCKY SWORD :O"]:Clone().Parent = player.BackPack
elseif Roar == 17 or 18 or 19 or 20 then
game.ServerStorage.Blame.TextLabel = "Blame"..player.Name.."for this"
for _, v in pairs(game.Players:GetChildren()) do
game.ServerStorage.Blame:Clone().Parent = v.PlayerGui

wait (2)
v.PlayerGui.Blame:Destroy()
end
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
wait (0.2)
local ShrekStorm = game.Lighting["Shrek (emerald lucky block)"]:Clone()
ShrekStorm.Parent = game.Workspace
ShrekStorm:MakeJoints()
elseif Roar == 21 or 22 or 23 or 24 or 25 then
script.Parent:Clone().Parent = player.Backpack
script.Parent:Clone().Parent = player.Backpack
script.Parent:Clone().Parent = player.Backpack
elseif Roar == 26 or 27 or 28 or 29 or 30 then
local TNT = true
wait (10)
TNT = false
while TNT == true do
local Clone = game.Workspace.RealTNT:Clone()
Clone.Parent = game.Workspace
local TNTSpot = math.random(1,42)
if TNTSpot == 1 then
Clone.CFrame = game.Workspace.TNT1.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 2 then
Clone.CFrame = game.Workspace.TNT2.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 3 then
Clone.CFrame = game.Workspace.TNT3.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 4 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 5 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 6 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 7 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 8 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 9 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 10 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 11 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 12 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 13 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 14 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 15 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 16 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 17 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 18 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 19 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 20 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 21 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 22 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 23 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 24 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 25 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 26 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 27 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 28 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 29 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 30 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 31 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 32 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 33 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 34 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 35 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 36 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 37 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 38 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 39 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 40 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 41 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)
elseif TNTSpot == 42 then
Clone.CFrame = game.Workspace.TNT..TNTSpot.CFrame * CFrame.new(0,-5,0)







end


end







end







end)

I would thank you if u helpoed me

2 comments

0

my eyes are popping

0

Don't use Lighting, it is easily exploitable.

1 answer

Put the tools that you want the players to get in ReplicatedStorage

Also what would be helpful is to print the random number you got. fx.

print(Roar)

Also if it is in a normal script then you get the character like this:

local char = game.Workspace:FindFirstChild(player.name)

and use a wait function too.

Very simple mistakes :D

13 comments

0

i did put the tools in serverstorage Why replicatedstorage?

0

Huh im putting print but its not printing the number for some reason

0

Oh also there is a error with the giving scripts something about local player and random backpacks and stuff

0

Maybe make it wait

0

ReplicatedStorage is designed for cloning items as in its name. ServerStorage is okay, but sometimes doesn't work. Don't use Lighting though, it is easily exploitable.

0

its not the item problem its the player.backpack problem it shows a error with that

0

there is this error in the giving thing about the character = nil and print still doesnt show even with wait

0

hm ok i managed to fix the print problem but i dont understand why the features dont work

0

Is it in a local script?

0

:/ that is a stupid question :///

0

uh max i dont need the character :/

0

Uh yeah, if you are setting the tool's parent is equal to the player then you also need the character.

0

ok but why doesnt other stuff work atleast

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