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

07:50:54.769 - Unable to cast value to Object?

Asked by 6 years ago

So working on FE script and having some problems with :FireClient everytime I run the script I get the error message shown in the title these are the scripts

SCRIPT 1 - Script located in ClickDetector

script.Parent.MouseClick:connect(function()
    game:GetService("ReplicatedStorage").OnEat:FireClient("eat")
end)

Script 2 - Local Script located in workspace.

game.ReplicatedStorage.OnEat.OnServerEvent:connect(function(Player, eat)



    local Character = Player.Character
    local Humanoid = Character.Humanoid
    local BDS = Humanoid.BodyDepthScale
    local BHS = Humanoid.BodyHeightScale
    local BWS = Humanoid.BodyWidthScale
    local HS = Humanoid.HeadScale
    local points = game.Players.LocalPlayer.leaderstats.Points
    local rebirth = game.Players.LocalPlayer.leaderstats.Rebirth    

    BDS.Value = BDS.Value +0.03*rebirth.Value
    BHS.Value = BHS.Value +0.03*rebirth.Value
    BWS.Value = BWS.Value +0.03*rebirth.Value
    HS.Value = HS.Value +0.03*rebirth.Value
    Humanoid.WalkSpeed = Humanoid.WalkSpeed + 0.03 
    points.Value = points.Value +1*rebirth.Value

end)

Answer this question