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

How to fix "ServerScriptService.Remotes:13: attempt to call a userdata value" ?

Asked by 3 years ago
Edited 3 years ago

Im trying to make a debounce but it shows the error in the title. Whats the problem

local replicatedStorage = game:GetService("ReplicatedStorage") local remoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData")

local cooldown = 1

replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)

if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end




if not remoteData(player.Name).debounce then 

    remoteData(player.Name).debounce.Value = true

    player.leaderstats.Strength.Value = player.leaderstats.StrengthValue + 25 * (player.leaderstats.Ranks.Value + 1)

    wait(cooldown)

    remoteData(player.Name).debounce.Value = false


end

end)

0
I think it’s because you didn’t put a . between strength and value when you are trying to add DarkDanny04 407 — 3y
0
False, he forgot .Value after debounce on line 06. SilentsReplacement 468 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

There.

if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end




if remoteData(player.Name).debounce.Value = false then 

    remoteData(player.Name).debounce.Value = true

        player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 25 * player.leaderstats.Ranks.Value + 1          

    wait(cooldown)

    remoteData(player.Name).debounce.Value = false


end

Happy to help, if you have any other questions feel free to add me on Discord: Haunted#5196

Ad

Answer this question