Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

on touch make a gui appear and insert something to player?

Asked by
gjlkv1 11
4 years ago
Edited 4 years ago

I made the both scripts but they didnt work ? asked it before understand it now its cause cant do 2 things with 1 scrits but how do do that basicaly

local Model = script.Parent
local SafeZoneDetector = Model
SafeZoneDetector.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("HumanoidRootPart") and hit.Parent:FindFirstChild ("SafeZone Protection") == nil then
        local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
        local Forcefield = Instance.new("ForceField")
        Forcefield.Name = "SafeZone Protection"
        Forcefield.Visible = false
        Forcefield.Parent = hit.Parent
    end
end)
SafeZoneDetector.TouchEnded:Connect(function(hit)
 wait (60)
    if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("HumanoidRootPart") and hit.Parent:FindFirstChild ("SafeZone Protection") == nil then
        hit.Parent:FindFirstChild("SafeZoneProtection"):Destroy()
    end
end) 

But ? also need a gui to get shown too help

0
I don't see the problem yet, please explain more. EmK530 143 — 4y
0
? need a gui to pop up with the same function on this script gjlkv1 11 — 4y
0
Does the gui disappear when you leave the safezone and where is this gui located and what is it called? EmK530 143 — 4y
0
Add the gui JesseSong 3916 — 4y
View all comments (5 more)
0
There's the problem, he can't. EmK530 143 — 4y
0
1.StarterGui.ScreenGui.Frame.Unsafed+Bar and ? need a 2nd entering safe zone will also make StarterGui.ScreenGui.Frame.Safed visible gjlkv1 11 — 4y
0
So Unsafed is visible at the start and Safed isn't? EmK530 143 — 4y
0
They both arent when you touch the script.Parent 1st gui gets visible and when you get out 2nd gui gets visible and it shrinks gjlkv1 11 — 4y
0
I made it pretty simple as I did not see the comment while I made the answer. EmK530 143 — 4y

1 answer

Log in to vote
0
Answered by
EmK530 143
4 years ago

To make the solution easier to see after a long comment conversation I just decided to make an answer:

Add this under line 5:

game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerGui.ScreenGui.Frame.Unsafed.Visible = false
game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerGui.ScreenGui.Frame.Safed.Visible = true

And add this under line 13

game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerGui.ScreenGui.Frame.Unsafed.Visible = true
game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerGui.ScreenGui.Frame.Safed.Visible = false
0
?nserting a force field is a normal script but making a gui visible is a local scirpt gjlkv1 11 — 4y
0
Actually, it's not. EmK530 143 — 4y
Ad

Answer this question