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

Can someone help with simulator door which buys access to the next zone?

Asked by 5 years ago

If there is anything wrong with anything from these codes pls correct. Buy Desert Script local UnlockButton = script.Parent.SurfaceGui.UnlockButton local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvents = ReplicatedStorage.RemoteEvents local DesertDoorBought = RemoteEvents.DesertDoorBought
UnlockButton.MouseButton1Click:Connect(function() --Fires when you click the Unlock button wait(0.1) DesertDoorBought:FireServer() end) DesertDoorBought.FireServer:Connect(function() end)

Remote Event --- DesertDoorBought

local plrs = game.Players:GetChildren() local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvents = ReplicatedStorage.RemoteEvents local DesertDoorBought = RemoteEvents.DesertDoorBought local CurrentValue = plrs.PlayerStats.CurrentValue DesertDoorBought.OnServerEvent:Connect(function(Player) local PlainAndDesDivider = game.Workspace.PlainAndDesDivider if CurrentValue >= 200 then PlainAndDesDivider.Transparency = 1 PlainAndDesDivider.CanCollide = false CurrentValue = CurrentValue - 200 else end end)

The error is: ServerScriptService.DesertBuy Handler:6: attempt to index field 'PlayerStats' (a nil value)

0
is this a free model..... starmaq 1290 — 5y

Answer this question