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

A Player Picker not working properly... Says stuff about nil value... Help?

Asked by
KAAK82 16
10 years ago
local Players = game.Players:GetPlayers()
local TopHat = { }
fBeastSpawn = game.Workspace.Map1.MapData.BeastSpawns.fBeastSpawn
sBeastSpawn = game.Workspace.Map1.MapData.BeastSpawns.sBeastSpawn
BeastSpawns = {fBeastSpawn, sBeastSpawn}

table.insert(TopHat, Player)
for _, Player in pairs(Players) do
for i=1, Player.chancestats.RW.Value do 
TopHat[#TopHat + 1] = Player 
end
end

local Beast = TopHat[math.random(1, #TopHat)]
wait(30)

local scythe = game:service('ServerStorage'):findFirstChild('Scythe');
if scythe ~= nil then
scythe:clone().Parent = Beast:WaitForChild('Backpack');
game.Players.LocalPlayer.Backpack.scythe.Parent = game.Players.LocalPlayer.Character
end

local BHumanoid = Beast.Humanoid
BHumanoid.MaxHealth = "1000"
BHumanoid.Health = "1000"
BHumanoid.WalkSpeed = "20"

Beast.TeamColor = BrickColor.new("Really Black")

local Exp = Instance.new("SpecialMesh",Beast.Torso)
Exp.MeshType = Enum.MeshType.FileMesh
Exp.MeshId = "http://www.roblox.com/asset/?id=42579239"
Exp.TextureId = "http://www.roblox.com/asset/?id=42578558"
Exp.VertexColor = Color3.new(-90, -100, 47)
Exp.Scale = Vector3.new(10, 10, 10)

local CBSpawn = BeastSpawns[math.random(1, #BeastSpawns)]
Beast:MoveTo(CBSpawn.Position)
0
Jesus Christ!!!!!!!!!!!! I a gave my Script and yas aren't Happy!!? wat the hell!!? Thumbs Down for nothin! the guy that did this is seriously Stupid! KAAK82 16 — 10y
0
._. IntellectualBeing 430 — 10y
0
._. ConnorVIII 448 — 10y

2 answers

Log in to vote
0
Answered by
istiyak 13
10 years ago

On the 17 line,

local scythe = game:service('ServerStorage'):findFirstChild('Scythe');

Have you tried putting your "scythe" in lighting? So try copying your script on a separate script in workspace,

0
but if a Player is picked he cant be Defined as his Name cant be changed... and so my only choice is inside the same script cos then the system knows that the Beast is the picked Player KAAK82 16 — 10y
Ad
Log in to vote
-1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

Change:

local scythe = game:service('ServerStorage'):findFirstChild('Scythe');

To:

local scythe = game.SeverStorage:findFirstChild("Scythe")

:service() is deprecated.

0
k, thnx... and wat u mean depricated? KAAK82 16 — 10y
0
You could google it, but it basically means Roblox used to use it, but not anymore, like :children(). Now you should use :GetChildren() instead of :children() and :GetService() instead of :service. Perci1 4988 — 10y

Answer this question