You can write your topic however you want, but you need to answer these questions:
-
**What do you want to achieve?**I want to get the client to recognize my parameter variables sent from the server
-
**What is the issue? ** The script does not recognize my premeter variables and it shows any when typed out
-
** I tried to rewrite the code but the issue is still happening
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Server
local player = game.Players
-- Main Stats & values
player.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "leaderstats"
Leaderstats.Parent = Player
-- Cash Stats
local Cash = Instance.new("NumberValue")
Cash.Name = "Cash"
Cash.Parent = Player
Cash.Value = 0
-- Housing Cost
local HouseValue = Instance.new("NumberValue")
HouseValue.Name = "Cost"
local House = game.Workspace.HouseDoor
local ClickDetector = House:FindFirstChild("ClickDetector")
ClickDetector.Parent = House
ClickDetector.MouseClick:Connect(function()
local RemoteEvent = game.ReplicatedStorage.ShowPriceUI
RemoteEvent:FireClient(Player,HouseValue,Cash)
end)
end)
Client
local House_Value_UI = game.Players.LocalPlayer.PlayerGui.HousePrompt.Frame.Price
local CancelButton = game.Players.LocalPlayer.PlayerGui.HousePrompt.Frame.Cancel
local cancled = false
local Event = game.ReplicatedStorage.ShowPriceUI
local MayEnter = false
Event.OnClientEvent:Connect(function(HouseValue,Cash)
House_Value_UI.Text = HouseValue.Value
local Player = game.Players.LocalPlayer.PlayerGui
local HousePrompt = Player.HousePrompt.Frame
local IsPurchased = false
local PurchaseButton = HousePrompt.Purchase
print("The event fired")
PurchaseButton.MouseButton1Click:Connect(function()
end)
print("The button has been clicked")
if Cash.Value >= HouseValue then
print("Purchase sucessful!")
IsPurchased = true
else
if Cash.Value < HouseValue then
print(Player.Name .. " You do not have enough money ")
IsPurchased = false
end
if IsPurchased == true then
print(Player.Name .. " Sucessfully purchased House ")
MayEnter = true
local HouseDoor = game.Workspace.HouseDoor
if MayEnter then
HouseDoor.CanCollide = false
end
CancelButton.MouseButton1Click:Connect(function()
cancled = true
end)
if cancled then
print(Player.Name .. " Has cancled the pruchase ")
wait(5)
game.Players.LocalPlayer.PlayerGui.HousePrompt.Frame.Visible = false
end
end
end
end)
Hello, I got a issue with remote events where i sent the parameters of my variables I want to change from the server to the client and the client does not recognize them why is this happening Thanks for your help