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

I keep getting an error but I dont know how to fix it?

Asked by 10 years ago

I've made this fireball script but it keeps giving me an error on line 8 saying "player is not a valid member of DataModel" Script:

player = game.Players.LocalPlayer
mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
        key = key:lower()
    if key == "q" then
for i = 0,0.5,.1 do
    wait()
RightShoulder = game.player.Character.Torso["Right Shoulder"]
RightShoulder.C0 = RightShoulder.C0 * CFrame.fromEulerAnglesXYZ(0,-i,0)
end
for q = 0,0.5,.1 do
    wait()
RightShoulder.C0 = RightShoulder.C0 * CFrame.fromEulerAnglesXYZ(q,0,0)
end
for i = 0,0.5,.1 do
    RightShoulder.C0 = RightShoulder.C0 * CFrame.fromEulerAnglesXYZ(-i,0,0)
        wait()
end
for i = 0,0.5,.1 do
    RightShoulder.C0 = RightShoulder.C0 * CFrame.fromEulerAnglesXYZ(0,i,0)
        wait()
end
        for i = 3,45 do
            missle = Instance.new("Part", workspace)
            missle.Size = Vector3.new(20,20,20)
            missle.Name = "Ball"
            missle.Shape = "Ball"
            missle.BrickColor = BrickColor.new("Bright red")
            f = Instance.new("Fire")
            f.Hear = 25
            f.Size = 30
            missle.Anchored = true
            missle.CFrame = CFrame.new(missle.Position + 3, 3)
            player.Character.Torso.Anchored = true
            dmg = game.Lighting.Script:Clone()
            dmg.Parent = missle
        end
        player.Character.Torso.Anchored = false
end
end)

2 answers

Log in to vote
0
Answered by
Ryzox 220 Moderation Voter
10 years ago

You put "game.player" it should just be "player" :)

Ad
Log in to vote
1
Answered by 10 years ago

RightShoulder = game.player.Character.Torso["Right Shoulder"]

Change to: RightShoulder = player.Character.Torso["Right Shoulder"]

This is because you previously called Player.

Answer this question