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

ServerStorage Is not a valid memeber of DataModel?

Asked by
Jirozu 71
7 years ago

I made a combat script that works fine in studio but when i play it in the actual roblox player, it pops up with this error:

"21:47:56 -- ServerStorage Is not a valid memeber of DataModel 21:47:56 -- Stack Begin 21:47:56 -- Script 'Player.iEchoFalcon.BackPack.PlayerStuffs.Combat', Line 13 21:47:56 -- Stack End"

Also, here is the combat script:

--\\Player Variables
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character or Player.Character.Parent
Character = Player.Character
--\\Variables
local Mouse = Player:GetMouse()
local Combo = 0
local Disabled = false

Mouse.Button1Down:connect(function()
    if Combo == 0 and Disabled == false then --Right Punch
        Disabled = true
        local Animation = Character.Humanoid:LoadAnimation(game.ServerStorage.Animations.Combat.RightPunch)
        local current = Animation
        current:Play()
        Character.Animate.Disabled = true
        wait(0.6)
        Combo = 1
        Disabled = false
        current:Stop()
        Character.Animate.Disabled = false

    elseif Combo == 1 and Disabled == false then --Left Punch
        Disabled = true
        local Animation = Character.Humanoid:LoadAnimation(game.ServerStorage.Animations.Combat.LeftPunch)
        local current = Animation
        current:Play()
        Character.Animate.Disabled = true
        wait(0.6)
        Combo = 2
        Disabled = false
        current:Stop()
        Character.Animate.Disabled = false

    elseif Combo == 2 and Disabled == false then --Right Kick
        Disabled = true
        local Animation = Character.Humanoid:LoadAnimation(game.ServerStorage.Animations.Combat.RightKick)
        local current = Animation
        current:Play()
        Character.Animate.Disabled = true
        wait(0.7)
        Combo = 3
        Disabled = false
        current:Stop()
        Character.Animate.Disabled = false

    elseif Combo == 3 and Disabled == false then --Left kick
        Disabled = true
        local Animation = Character.Humanoid:LoadAnimation(game.ServerStorage.Animations.Combat.LeftKick)
        local current = Animation
        current:Play()
        Character.Animate.Disabled = true
        wait(0.7)
        Combo = 0
        Disabled = false
        current:Stop()
        Character.Animate.Disabled = false
    end
end)
0
What type of script was this in (LocalScript, Script, Or ModuleScript)? LevelHeadedLogic 13 — 7y
0
LocalScript Jirozu 71 — 7y

1 answer

Log in to vote
7
Answered by
cabbler 1942 Moderation Voter
7 years ago

LocalScripts can't access ServerStorage, that's the point! You will have to place your animations in ReplicatedFirst, or ReplicatedStorage if the server also needs them.

Ad

Answer this question