I tried do to a Gate Script and now it says "ServerScriptService.HalloweenGates Unlock:7: attempt to compare string <= number " The Error is in ServerScriptService Line 7 Pls help me
Script (Local) :
local Activator = game.Workspace:WaitForChild("Haunted Gate Gate").Activator --Gate
local GuiText = "Do you want to buy the Haunted Gate?" --Text For The Gui
local Price = 100000 --Price
local GateName = "HauntedEntrance" --Name to unlock
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("HalloweenGates")
Activator.Touched:Connect(function(hit)
if hit.Parent == game.Players.LocalPlayer.Character then
print("Touched")
local player = game.Players.LocalPlayer
remoteEvent:FireServer(player, GuiText, Price, GateName)
end
end)
Script (ServerScriptService) :
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("HalloweenGates")
local TakeMoney = ReplicatedStorage:WaitForChild("HalloweenGatesTakeMoney")
remoteEvent.OnServerEvent:Connect(function(player, GuiText, Price, GateName)
if player.EventMoney.Sweets.Value >= Price then
player.StarterGui.HalloweenGates.Frame.Visible = true
player.StarterGui.HalloweenGates.Shadow.Visible = true
player.StarterGui.HalloweenGates.Frame.Price.Text = "This Gate costs"..Price.."Coins"
player.StarterGui.HalloweenGates.Frame.Buy.Gate.Value = GateName
player.StarterGui.HalloweenGates.Frame.Buy.Price.Value = Price
end
end)
TakeMoney.OnServerEvent:Connect(function(player, Price)
player.EventMoney.Sweets.Value = player.EventMoney.Sweets.Value - Price
end)
