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)

1 comment
the first argument of fireclient has to be a player object