Mrdmlxo
(Mrdmlxo)
#1
Just a gui with localscript and touched function. I wanted it works for touched guy only but not working.
why aa… They work for all users dam
I searched post like it(How Do I Make A Gui Show To A Local Player? - #3 by ClientRecon)
But as you see, I made like them already… What’s problem?
You should check if Players == game.Players.LocalPlayer
before you do anything with the GUI
Mrdmlxo
(Mrdmlxo)
#3
meant line 9?
I added 'Localplayer; but not worked…
he meant you replace the players variable with just game.Players.LocalPlayer
basically this
local Players = game.Players.LocalPlayer
Mrdmlxo
(Mrdmlxo)
#5
like it?
It didnt work…
Maybe should I use playergui? I did this work in startergui so It may not work because of it
I didn’t mean either of those things. Modify the if statement in your original code like this:
if painr and Players==game.Players.LocalPlayer then
Mrdmlxo
(Mrdmlxo)
#7
You solved final problem in first version of my game! Thank you sooooo much
1 Like
local debounce = false
local nans = 0
local rimuas = Instance.new("Sound")
rimuas.Parent = workspace
rimuas.SoundId = "rbxassetid://3416832063"
rimuas.Volume = 1
rimuas.PlaybackSpeed = 1
local checkpoint = workspace:WaitForChild("Checkpoint")
local players = game:GetService("Players")
local player = players.LocalPlayer or players.PlayerAdded:Wait()
checkpoint.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("HumanoidRootPart") then
local char = hit.Parent
local plr = players:GetPlayerFromCharacter(char)
if plr.Name == player.Name then
if debounce then
return
end
debounce = true
rimuas:Play()
script.Parent.Visible = true
--tween code
repeat
task.wait(0.1)
nans += 1
script.Parent.TextTransparency += 0.1
until nans >= 11
nans = 0
script.Parent.Visible = false
script.Parent.TextTransparency = 0
script.Parent.Position = UDim2.new(0.7, 0, 0.58, 0)
task.wait(3)
debounce = true
end
end
end)
I rewrote the script, don’t forget to paste in the “Tween” code, I’ve commented where.