Spinner Ui Crate Help!

Can someone help me?

SpinnerClient [LOCAL]:

Pastebin Link

repeat task.wait() until game.Players.LocalPlayer:FindFirstChild("leaderstats") - Pastebin.com

SpinnerContent [MODULE]:

Pastebin Link

local contents = {}--<<CONFIG>>contents["Price"] = 0;contents["Crates"] = - Pastebin.com

CaseSpinner [SERVER]:

Pastebin Link

--<<SERVICES>>local ReplicatedStorage = game:GetService("ReplicatedStorage") - Pastebin.com

Error: [The Image]

Where is the error being called: CLICK FUNCTION [IN SPINNERCLIENT]:

Summary

spin.MouseButton1Down:Connect(function() if spinDe then spinDe = false l - Pastebin.com

What am I trying to do?: Make a crate with spinner.

If you need any more information don’t be afraid to ask! Any help would be greatly appreciented

I cannot test this because I can’t be bothered to painstakingly recreate every single instance your script tries to index, but, I can say from just examining the code that you have 2 main problems:

1: line 11 of the serverscript:

if contents:PermissionToSpin(player) then
	return false
else

“if contents:PermissionToSpin(player) then” means that the InvokeServer will return false if permissionToSpin returns true.

2: line 156 of the localscript:

if not errorMessage then
	errorMessage = contents.Messages.ServerError
end

errorMessage is always nil, because your InvokeServer does not return a tuple of spinDetails, errorMessage; infact it never returns a tuple at all, all it returns is “false” when you have permission to spin, hence why the if statement on line 155 of the localscript:

if not spinDetails then

is always true, followed by the “if not errorMessage then” also always being true because errorMessage is nil. Atleast, that’s my assumption after reading the code, as I said I can’t test anything so everything I just said is conjecture. Hope it still helps. :crossed_fingers:

Ok so what should I do? My brain is breaking rn :sob::sob::sob:

If I’m right your code should immediately start working if you replace:

if contents:PermissionToSpin(player) then
	return false
else

with:

if not contents:PermissionToSpin(player) then
	return false
else

but since im guessing you also want it to tell the player when they dont have permission instead of just saying “404” you should do:

if not contents:PermissionToSpin(player) then
	return false, "Error: Not enough money!"
else

or something, I’m guessing. :crossed_fingers:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.