In the Server Script below I'm trying to clone a Billboard GUI that will be above the player's read and show the result of a math.random which is the result of a dice roll, I am cloning the Billboard GUI and parenting it to the player so it is shown above their head, the problem is that I'm using a RemoteEvent to send two datas, the player and the rollnumber which is the result, everything works until that line "DiceResult.TextLabel.Text = rollnumber.Text" where it says: Text is not a valid member of Player, could someone help me with that? I know that probably there is an easy fix to that but it is a problem so specific that I couldn't find others similar so I had to ask here, I appreciate the help.
Local Script activated through a button:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DiceRoll = ReplicatedStorage.DiceRoll
local player = game:GetService("Players").LocalPlayer
numbers = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}
roll = script.Parent.Window.Roll
rollnumber = script.Parent.Window.Number
enabled = true
roll.MouseButton1Down:connect(function()
if enabled == true then
rollnumber.Text = math.random(1,#numbers)
script.Parent.Sound:Play()
enabled = false
DiceRoll:FireServer(player, rollnumber)
wait(10)
enabled = true
end
end)
Server Script activated through the RemoteEvent:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local DiceRoll = ReplicatedStorage.DiceRoll
local Namer = ServerStorage.Namer
local function RollADice(player, rollnumber)
local DiceResult = Namer:Clone()
DiceResult.Name = "DiceResult"
DiceResult.Parent = player.Character.Head
DiceResult.TextLabel.Text = rollnumber.Text
wait(10)
DiceResult:Destroy()
end
DiceRoll.OnServerEvent:Connect(RollADice)

1 comment
EDIT: I decided to add the Local Script so you guys could have more information to use to help me out.