So my dice script consists of the decals and whatever decal lands up when the dice is thrown, that gui pops up. Well it only shows up on the throwers hand. Is there a fix?
Script: repeat wait(1) until script.Parent.Handle
local player = game.Players.LocalPlayer
local Character = player.Character
local Humanoid = Character.Humanoid
dice = script.Parent.Handle
DrinkAnim = script.Parent.DrinkAnim
local I = dice:FindFirstChild("1").Texture
local II = dice:FindFirstChild("2").Texture
local III = dice:FindFirstChild("3").Texture
local IV = dice:FindFirstChild("4").Texture
local V = dice:FindFirstChild("5").Texture
local VI = dice:FindFirstChild("6").Texture
scolor = script.Parent.Data.SureColor.Value.Color
dcolor = script.Parent.Data.DecideColor.Value.Color
playername = game.Players.LocalPlayer
tool = script.Parent
cooldown = true
rolltime = 0.25
displaytime = 5
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
local DrinkAnimTrack = Humanoid:LoadAnimation(DrinkAnim)
if DrinkAnimTrack then
DrinkAnimTrack:Play()
wait(1)
if cooldown == false then return end
cooldown = false
local die = dice:Clone()
die.DieGui.NameButton.Text = playername.Name.."'s dice"
die.Parent = game.Workspace
die.CanCollide = true
--display roll--
--display roll--
local obama = math.random(1,6)
die.DieGui.DieButton.Text = obama
local babes = die:GetChildren()
for i=1, #babes do
if babes[i].ClassName == "Decal" then
if obama == 1 then babes[i].Texture = I elseif obama == 2 then babes[i].Texture = II elseif obama == 3 then babes[i].Texture = III elseif obama == 4 then babes[i].Texture = IV elseif obama == 5 then babes[i].Texture = V elseif obama == 6 then babes[i].Texture = VI end
end end
die.DieGui.DieButton.TextColor3 = scolor
die.DieGui.Active = true
wait(5)
die.DieGui.Active = false
die:Destroy()
cooldown = true
end end)
end)
You are firing it only on the client side instead of server side. To fire it on server side you must use remote events. You can check this to get an idea: https://developer.roblox.com/api-reference/class/RemoteEvent This to see how the event firing should look like: https://developer.roblox.com/articles/Remote-Functions-and-Events You could also check this youtube tutorial that i think explained it the best (well at least from my pov): https://www.youtube.com/watch?v=4Dc_bri9mjs