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

Unable to cast value to Object?

Asked by 5 years ago

Hello, I have the problem that I get this error message, but can't tell why.

Log: GoldenretriverLP 20:52:23.583 - Unable to cast value to Object 20:52:23.584 - Stack Begin 20:52:23.584 - Script 'Workspace.Apple.AppleScript', Line 12 20:52:23.585 - Stack End

AppleScript:

local Tool = script.Parent;

enabled = true

function onActivated()

if not enabled then
return
end

game.Players[Tool.Parent.Name].leaderstats.Apples.Value = game.Players[Tool.Parent.Name].leaderstats.Apples.Value + 1

print(Tool.Parent.Name)
game.ReplicatedStorage.UI:FireClient("drawApple", 1, Tool.Parent.Name)
enabled = false
wait(1)
enabled = true
end

script.Parent.Activated:connect(onActivated)

game.ReplicatedStorage.UI:FireClient("drawApple", 1, Tool.Parent.Name) = game.ReplicatedStorage.UI:FireClient(func, val, plr)

0
the first argument of fireclient has to be a player object theking48989987 2147 — 5y

Answer this question